import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;

public class Test05 {
    public static void main(String[] args) {
        HashMap<Student,String> hm=new HashMap<>();
        Student s1=new Student("张三",23);
        Student s2=new Student("李四",24);
        Student s3=new Student("王五",25);
        hm.put(s1,"山东");
        hm.put(s2,"江苏");
        hm.put(s3,"北京");
        /*Set<Student> keys=hm.keySet();
        for(Student key:keys){
            String value=hm.get(key);
            System.out.println(key+"="+value);
        }*/
        /*Set<Map.Entry<Student,String>> entries=hm.entrySet();
        for(Map.Entry<Student,String> entry:entries){
            Student key=entry.getKey();
            String value=entry.getValue();
            System.out.println(key+"="+value);

        }*/
        hm.forEach(new BiConsumer<Student, String>() {
            @Override
            public void accept(Student key, String value) {
                System.out.println(key+"="+value);
            }
        });
    }
}
